package com.learn.springlearn.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class SingletonUtil {


    private final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    private final DateTimeFormatter DTF = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    private SingletonUtil() {

    }

    public static SingletonUtil getInstance() {
        return Nest.singletonUtil;
    }

    static class Nest {
        private static SingletonUtil singletonUtil = new SingletonUtil();
    }

    public void parseDate() {
        LocalDateTime parse = LocalDateTime.parse("2020-12-23 23:59:59", DTF);

//            SDF.parse("2020-12-23 23:59:59");

    }


}
